
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "uart_if.h"
#include "comm.h"


#define tc_log(_fmt_, ...)          printf("[TC][%s:%d][%s] "_fmt_"\r\n", __FILE__, __LINE__, __func__, ##__VA_ARGS__)
#define tc_log_err(_fmt_, ...)      printf("[TC][ERR][%s:%d][%s] "_fmt_"\r\n", __FILE__, __LINE__, __func__, ##__VA_ARGS__)


static void hex_dump(char *desc, unsigned char *data, int len)
{
    unsigned int i;

    printf("%s size %d hex dump:", desc, len);
    for(i=0; i<len; i++)
    {
        if (i % 16 == 0)
            printf("\n%p: ", &data[i]);

        printf(" %02x", data[i]);
    }
    printf("\n");
}

int main(int argc, char const *argv[])
{
	tc_log("********************");
	tc_log("this is a new start.");
	tc_log("********************");

	if (lua_arch_init() != LUA_ARCH_OK)
		return -1;

	if (lua_arch_start() != LUA_ARCH_OK)
		return -2;

	sleep(2 * 60);

	lua_arch_stop();

	tc_log("exit");
	return 0;
}

